﻿Partial Public Class MainPage
    Inherits UserControl

    Public Sub New()
        InitializeComponent()
    End Sub

    Private Sub CurrentGamesListBox_SelectionChanged(ByVal sender As System.Object, ByVal e As System.Windows.Controls.SelectionChangedEventArgs) Handles CurrentGamesListBox.SelectionChanged
        If CurrentGamesListBox.SelectedIndex = -1 Then
            EnterGameButton.IsEnabled = False
        Else
            EnterGameButton.IsEnabled = True
        End If
    End Sub

    Private Sub EnterGameButton_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles EnterGameButton.Click
        GameName = CurrentGamesListBox.SelectedItem
        DS.GamePageAsync(DisplayID, CurrentGamesListBox.SelectedItem)
    End Sub
End Class